package com.sino.second.business.service;

import java.util.ArrayList;
import java.util.List;

import com.sino.second.bean.SysXmpsdj;
import com.sino.second.bean.SysXmpszb;
import com.sino.second.dao.hibernate.BaseDataDAO;
import com.sino.second.model.XmpsdjModel;
import com.sino.second.model.XmpszbModel;
import com.sino.second.util.BeanAndModelConverter;

public class BaseDataService {
	private BaseDataDAO baseDataDAO=null;//基础类数据DAO
	public List<XmpszbModel> getXmpszb(){
		List<SysXmpszb> sxList=this.getBaseDataDAO().findXmpszbList();
		List<XmpszbModel> xmpsmList=new ArrayList<XmpszbModel>();
		
		for(SysXmpszb sx:sxList){
			xmpsmList.add(BeanAndModelConverter.getXmpszbModel(sx));
		}
		return xmpsmList;
	}
	public List<XmpsdjModel> getXmpsdjModelByXmpsdj(){
		List<SysXmpsdj> sxList=this.getBaseDataDAO().findXmpsdjList();
		List<XmpsdjModel> xdmList=new ArrayList<XmpsdjModel>();
		for(SysXmpsdj sx:sxList){
			xdmList.add(BeanAndModelConverter.getXmpsdjModelByXmpsdjBean(sx));
		}
		return xdmList;
		
	}
	public BaseDataDAO getBaseDataDAO() {
		return baseDataDAO;
	}
	public void setBaseDataDAO(BaseDataDAO baseDataDAO) {
		this.baseDataDAO = baseDataDAO;
	}
	


}
